import React, { Component } from 'react'

class TodoItem extends Component {

  constructor (props) {
    super(props)
    this.handleClick = this.handleClick.bind(this)
  }

  render () {
    const { content } = this.props
    return (
      <div className="item" onClick={this.handleClick}>
        {content}
      </div>
    )
  }

  handleClick (e) {
    const { handleItemDelete, index } = this.props
    handleItemDelete(index)
  }
}

export default TodoItem
